
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.ClassNotFoundException;
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;


public class test_client {

	public static void main(String[] args) {
        try {
            InetAddress host = InetAddress.getLocalHost();
            Socket socket = new Socket("localhost", 7777);
            bg.tu.varna.pms.model.communication.LoginMessage.Request lgmsg = new bg.tu.varna.pms.model.communication.LoginMessage.Request();
            lgmsg.setUsername("niki");
            lgmsg.setPassword(new char[]{'q','w','e','r','t'});
            ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
            oos.writeObject(lgmsg);
 //           oos.writeObject("Hello There...");

            //
            // Read and display the response message sent by server application
            //
            ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
  //          String message = (String) ois.readObject();
  //          System.out.println("Message: " + message);

            ois.close();
            oos.close();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } 
        //catch (ClassNotFoundException e) {
        //    e.printStackTrace();
        //}
    }
}

